package com.zghhost.codedemo.other;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zghhost.codedemo.util.IOUtil;

import java.io.File;
import java.io.FileInputStream;

/**
 * @author guohua.zhang@zhaopin.com.cn
 * @Date 2019/5/15 16:42
 */
public class JsonParser {
    public static void main(String[] args)throws Exception{
        File file = new File("/Users/wow/Desktop/xunfeizhuanhuan.json");
        String json = IOUtil.is2str(new FileInputStream(file));
        JSONArray arr = JSONArray.parseArray(json);

        for(int i=0,ic=arr.size();i<ic;i++){
            JSONObject job = arr.getJSONObject(i);
            System.out.println(job.getString("onebest"));
        }
    }
}
